package com.zretc.service.impl;

import com.zretc.dao.CartMapper;
import com.zretc.entity.Cart;
import com.zretc.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author WHP
 */
@Service
public class CartServiceImpl implements CartService {
    @Autowired
    private CartMapper cartMapper;
    @Override
    public List<Cart> findCartAllList(Integer userId) {
        return cartMapper.findCartAll(userId);
    }

    @Override
    public Cart findCartAllBycartIdList(Integer cartId) {
        return cartMapper.findCartAllBycartId(cartId);
    }

    @Override
    public int deleteCartByCartId(Integer cartId) {
        return cartMapper.deleteCartByCartId(cartId);
    }

    @Override
    public int updateCartList(Integer cartId, Integer cartCount) {
        return cartMapper.updateCart(cartId,cartCount);
    }

    @Override
    public int insertCart(Cart cart) {
        return cartMapper.insertCart(cart);
    }
}
